package ch6;

public class Zuoye8 {//输出1-10000以内所有的质数并统计个数

    public static void main(String[] args) {
        int b = 0;
        for (int i = 2; i < 10000; i++) {
            int a = 0;
            for (int d = 2; d < i; d++) {
                if (i % d == 0) {
                    a++;
                }
            }
            if (a == 0) {
                b += i;
            }
        }
        System.out.println(b);
    }
}
